You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/games-emulation/dosbox/files/dosbox-0.74-clang.patch

49 lines
1.7 KiB

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=449060
Two backports from Dosbox SVN needed for clang support:
src/fpu/fpu_instructions_x86.h changes are revision 3841
src/cpu/core_dynrec/risc_x64.h changes are revision 3894
Index: src/fpu/fpu_instructions_x86.h
===================================================================
--- a/src/fpu/fpu_instructions_x86.h (revision 3840)
+++ b/src/fpu/fpu_instructions_x86.h (revision 3841)
@@ -1161,12 +1161,12 @@
static void FPU_FLD_I16(PhysPt addr,Bitu store_to) {
fpu.p_regs[8].m1 = (Bit32u)mem_readw(addr);
- FPUD_LOAD(fild,WORD,)
+ FPUD_LOAD(fild,WORD,s)
}
static void FPU_FLD_I16_EA(PhysPt addr) {
fpu.p_regs[8].m1 = (Bit32u)mem_readw(addr);
- FPUD_LOAD_EA(fild,WORD,)
+ FPUD_LOAD_EA(fild,WORD,s)
}
static void FPU_FLD_I32(PhysPt addr,Bitu store_to) {
@@ -1211,7 +1211,7 @@
}
static void FPU_FST_I16(PhysPt addr) {
- FPUD_STORE(fistp,WORD,)
+ FPUD_STORE(fistp,WORD,s)
mem_writew(addr,(Bit16u)fpu.p_regs[8].m1);
}
Index: src/cpu/core_dynrec/risc_x64.h
===================================================================
--- a/src/cpu/core_dynrec/risc_x64.h (revision 3893)
+++ b/src/cpu/core_dynrec/risc_x64.h (revision 3894)
@@ -85,7 +85,8 @@
static INLINE void gen_reg_memaddr(HostReg reg,void* data) {
Bit64s diff = (Bit64s)data-((Bit64s)cache.pos+5);
- if ((diff<0x80000000LL) && (diff>-0x80000000LL)) {
+// if ((diff<0x80000000LL) && (diff>-0x80000000LL)) { //clang messes itself up on this...
+ if ( (diff>>63) == (diff>>31) ) { //signed bit extend, test to see if value fits in a Bit32s
cache_addb(0x05+(reg<<3));
// RIP-relative addressing is offset after the instruction
cache_addd((Bit32u)(((Bit64u)diff)&0xffffffffLL));