diff --git a/cmake/BCCompiler.cmake b/cmake/BCCompiler.cmake index c7c604ecc..9d24ca4ed 100644 --- a/cmake/BCCompiler.cmake +++ b/cmake/BCCompiler.cmake @@ -19,7 +19,7 @@ set(DEFAULT_BC_COMPILER_FLAGS -ffreestanding -fno-common -fno-builtin -fno-exceptions -fno-rtti -fno-asynchronous-unwind-tables -Wno-unneeded-internal-declaration -Wno-unused-function -Wgnu-inline-cpp-without-extern - -Wno-pass-failed=transform-warning + -Wno-pass-failed=transform-warning -Wno-packed-non-pod -std=c++17 ) diff --git a/include/remill/Arch/Runtime/Intrinsics.h b/include/remill/Arch/Runtime/Intrinsics.h index 00c151686..f645d3139 100644 --- a/include/remill/Arch/Runtime/Intrinsics.h +++ b/include/remill/Arch/Runtime/Intrinsics.h @@ -47,7 +47,7 @@ extern "C" { [[gnu::used]] extern float64_t __remill_read_memory_f64(Memory *, addr_t); [[gnu::used]] extern Memory *__remill_read_memory_f80(Memory *, addr_t, - native_float80_t &); + float80_t &); [[gnu::used]] extern float128_t __remill_read_memory_f128(Memory *, addr_t); @@ -58,7 +58,7 @@ extern "C" { float64_t); [[gnu::used]] extern Memory * -__remill_write_memory_f80(Memory *, addr_t, const native_float80_t &); +__remill_write_memory_f80(Memory *, addr_t, const float80_t &); [[gnu::used]] extern Memory *__remill_write_memory_f128(Memory *, addr_t, float128_t); diff --git a/include/remill/Arch/Runtime/Operators.h b/include/remill/Arch/Runtime/Operators.h index 285e15a5e..f18a5a9ca 100644 --- a/include/remill/Arch/Runtime/Operators.h +++ b/include/remill/Arch/Runtime/Operators.h @@ -173,13 +173,13 @@ MAKE_MREAD(64, 64, float, f64) #undef MAKE_MREAD ALWAYS_INLINE static float80_t _Read(Memory *&memory, Mn op) { - native_float80_t val; + float80_t val; memory = __remill_read_memory_f80(memory, op.addr, val); return val; } ALWAYS_INLINE static float80_t _Read(Memory *&memory, MnW op) { - native_float80_t val; + float80_t val; memory = __remill_read_memory_f80(memory, op.addr, val); return val; } diff --git a/tests/AArch64/Run.cpp b/tests/AArch64/Run.cpp index 2faf739d1..e150d4c75 100644 --- a/tests/AArch64/Run.cpp +++ b/tests/AArch64/Run.cpp @@ -147,14 +147,14 @@ MAKE_RW_FP_MEMORY(64) MAKE_RW_FP_MEMORY(128) NEVER_INLINE Memory *__remill_read_memory_f80(Memory *, addr_t addr, - native_float80_t &out) { - out = AccessMemory(addr); + float80_t &out) { + out = AccessMemory(addr); return nullptr; } NEVER_INLINE Memory *__remill_write_memory_f80(Memory *, addr_t addr, - const native_float80_t &in) { - AccessMemory(addr) = in; + const float80_t &in) { + AccessMemory(addr) = in; return nullptr; } diff --git a/tests/X86/Run.cpp b/tests/X86/Run.cpp index 12bd8f602..c4f4bb64d 100644 --- a/tests/X86/Run.cpp +++ b/tests/X86/Run.cpp @@ -186,14 +186,14 @@ MAKE_RW_FP_MEMORY(64) MAKE_RW_FP_MEMORY(128) NEVER_INLINE Memory *__remill_read_memory_f80(Memory *, addr_t addr, - native_float80_t &out) { - out = AccessMemory(addr); + float80_t &out) { + out = AccessMemory(addr); return nullptr; } NEVER_INLINE Memory *__remill_write_memory_f80(Memory *, addr_t addr, - const native_float80_t &in) { - AccessMemory(addr) = in; + const float80_t &in) { + AccessMemory(addr) = in; return nullptr; } diff --git a/tests/X86/X87/FLD.S b/tests/X86/X87/FLD.S index 09a915f72..e21c0b10d 100644 --- a/tests/X86/X87/FLD.S +++ b/tests/X86/X87/FLD.S @@ -27,6 +27,15 @@ TEST_INPUTS(TEST_INPUTS_MMX_QWORD) fld QWORD PTR [rsp] TEST_END_64 +TEST_BEGIN_64(FLDm80, 1) +TEST_INPUTS(0x0123456789ABCDEF) + sub rsp, 16 + mov QWORD PTR [rsp], ARG1_64 + mov WORD PTR [rsp + 8], 0x1337 + fld TBYTE PTR [rsp] + add rsp, 16 +TEST_END_64 + TEST_BEGIN_64(FLDst0, 1) TEST_INPUTS(TEST_INPUTS_MMX_QWORD) push ARG1_64 diff --git a/tests/X86/X87/FST.S b/tests/X86/X87/FST.S index 2eda9dd67..2be059629 100644 --- a/tests/X86/X87/FST.S +++ b/tests/X86/X87/FST.S @@ -78,6 +78,19 @@ FST_INPUTS fstp QWORD PTR [rsp] TEST_END_64 +TEST_BEGIN_64(FSTPm80, 1) +TEST_INPUTS(0x0123456789ABCDEF) + sub rsp, 16 + mov QWORD PTR [rsp], ARG1_64 + mov WORD PTR [rsp + 8], 0x1337 + fld TBYTE PTR [rsp] + mov WORD PTR [rsp + 8], 0x0 + fstp TBYTE PTR [rsp] + mov rax, QWORD PTR [rsp] + movzx rbx, WORD PTR [rsp + 8] + add rsp, 16 +TEST_END_64 + TEST_BEGIN_64(FSTPst, 1) FST_INPUTS