diff --git a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp index bfe7d117ec..4960c4c992 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPEmitter.cpp @@ -470,6 +470,10 @@ void DSPEmitter::CompileDispatcher() RET(); } +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Winvalid-offsetof" +#endif Gen::OpArg DSPEmitter::M_SDSP_pc() { return MDisp(R15, static_cast(offsetof(SDSP, pc))); @@ -503,5 +507,8 @@ Gen::OpArg DSPEmitter::M_SDSP_reg_stack_ptrs(size_t index) return MDisp(R15, static_cast(offsetof(SDSP, reg_stack_ptrs) + sizeof(SDSP::reg_stack_ptrs[0]) * index)); } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif } // namespace DSP::JIT::x64 diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp index d37e7fd460..617c92462a 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitMultiplier.cpp @@ -149,7 +149,14 @@ void DSPEmitter::multiply_mulx(u8 axh0, u8 axh1) // direct use of prod regs by AX/AXWII (look @that part of ucode). void DSPEmitter::clrp(const UDSPInstruction opc) { +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Winvalid-offsetof" +#endif int offset = static_cast(offsetof(SDSP, r.prod.val)); +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif // 64bit move to memory does not work. use 2 32bits MOV(32, MDisp(R15, offset + 0 * sizeof(u32)), Imm32(0xfff00000U)); MOV(32, MDisp(R15, offset + 1 * sizeof(u32)), Imm32(0x001000ffU)); diff --git a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp index 9e69daafab..31becddf8d 100644 --- a/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp +++ b/Source/Core/Core/DSP/Jit/x64/DSPJitRegCache.cpp @@ -20,6 +20,10 @@ namespace DSP::JIT::x64 constexpr std::array s_allocation_order = { {R8, R9, R10, R11, R12, R13, R14, R15, RSI, RDI, RBX, RCX, RDX, RAX, RBP}}; +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Winvalid-offsetof" +#endif static Gen::OpArg GetRegisterPointer(size_t reg) { switch (reg) @@ -95,6 +99,9 @@ static Gen::OpArg GetRegisterPointer(size_t reg) return M(static_cast(nullptr)); } } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif #define STATIC_REG_ACCS //#undef STATIC_REG_ACCS