summaryrefslogtreecommitdiff
blob: df2923f5caf90d742544a8caad028e0446a2069b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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));