CPU: Fix warnings

This commit is contained in:
darkstar
2018-03-09 01:15:32 +01:00
parent 483dd3c9cf
commit 2ec77c8fa0
8 changed files with 44 additions and 44 deletions

View File

@@ -8,7 +8,7 @@
*
* Implementation of the CPU.
*
* Version: @(#)386.c 1.0.1 2018/02/14
* Version: @(#)386.c 1.0.2 2018/03/09
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* Miran Grca, <mgrca8@gmail.com>
@@ -263,14 +263,14 @@ void exec386(int cycs)
uint8_t temp;
uint32_t addr;
int tempi;
int cycdiff;
int64_t cycdiff;
int oldcyc;
cycles+=cycs;
/* output=3; */
while (cycles>0)
{
int cycle_period = (timer_count >> TIMER_SHIFT) + 1;
int64_t cycle_period = (timer_count >> TIMER_SHIFT) + 1;
x86_was_reset = 0;
cycdiff=0;

View File

@@ -8,7 +8,7 @@
*
* Common 386 CPU code.
*
* Version: @(#)386_common.h 1.0.1 2018/02/14
* Version: @(#)386_common.h 1.0.2 2018/03/09
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* Miran Grca, <mgrca8@gmail.com>
@@ -281,4 +281,4 @@ static __inline void seteaq(uint64_t v)
#define rmdat rmdat32
#define fetchdat rmdat32
void x86_int(int num);
void x86_int(uint32_t num);

View File

@@ -8,7 +8,7 @@
*
* Implementation of the CPU's dynamic recompiler.
*
* Version: @(#)386_dynarec.c 1.0.1 2018/02/14
* Version: @(#)386_dynarec.c 1.0.2 2018/03/09
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* Miran Grca, <mgrca8@gmail.com>
@@ -226,7 +226,7 @@ static __inline void fetch_ea_16_long(uint32_t rmdat)
#include "x86_flags.h"
void x86_int(int num)
void x86_int(uint32_t num)
{
uint32_t addr;
flags_rebuild();
@@ -279,7 +279,7 @@ void x86_int(int num)
CPU_BLOCK_END();
}
void x86_int_sw(int num)
void x86_int_sw(uint32_t num)
{
uint32_t addr;
flags_rebuild();
@@ -446,7 +446,7 @@ static void prefetch_flush()
#define PREFETCH_FLUSH() prefetch_flush()
int checkio(int port)
int checkio(uint32_t port)
{
uint16_t t;
uint8_t d;

View File

@@ -18,7 +18,7 @@
* 2 clocks - fetch opcode 1 2 clocks - execute
* 2 clocks - fetch opcode 2 etc
*
* Version: @(#)808x.c 1.0.1 2018/02/14
* Version: @(#)808x.c 1.0.2 2018/03/09
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* Miran Grca, <mgrca8@gmail.com>
@@ -1230,7 +1230,7 @@ void execx86(int cycs)
break;
case 0x14: /*ADC AL,#8*/
tempw=FETCH();
setadc8(AL,tempw);
setadc8(AL,tempw & 0xff);
AL+=tempw+tempc;
cycles-=4;
break;
@@ -2968,7 +2968,7 @@ void execx86(int cycs)
if (temp)
{
tempw2=tempw%temp;
AH=tempw2;
AH=tempw2 & 0xff;
tempw/=temp;
AL=tempw&0xFF;
}

View File

@@ -20,7 +20,7 @@
* - PMMX decode queue
* - MMX latencies
*
* Version: @(#)codegen_timing_pentium.c 1.0.1 2018/02/14
* Version: @(#)codegen_timing_pentium.c 1.0.2 2018/03/09
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* Miran Grca, <mgrca8@gmail.com>
@@ -859,7 +859,7 @@ static inline int COUNT(uint64_t timings, uint64_t deps, int op_32)
fatal("Illegal COUNT %016llx\n", timings);
return timings;
return timings & 0xffffffff;
}
static int codegen_fpu_latencies(uint64_t deps, int reg)

View File

@@ -8,7 +8,7 @@
*
* CPU type handler.
*
* Version: @(#)cpu.h 1.0.3 2018/03/05
* Version: @(#)cpu.h 1.0.4 2018/03/09
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* leilei,
@@ -447,7 +447,7 @@ extern void cpu_CPUID(void);
extern void cpu_RDMSR(void);
extern void cpu_WRMSR(void);
extern int checkio(int port);
extern int checkio(uint32_t port);
extern void codegen_block_end(void);
extern void codegen_reset(void);
extern void cpu_set_edx(void);
@@ -467,7 +467,7 @@ extern void resetx86(void);
extern void refreshread(void);
extern void resetreadlookup(void);
extern void softresetx86(void);
extern void x86_int_sw(int num);
extern void x86_int_sw(uint32_t num);
extern int x86_int_sw_rm(int num);
extern void x86gpf(char *s, uint16_t error);
extern void x86np(char *s, uint16_t error);

View File

@@ -8,7 +8,7 @@
*
* x86 CPU segment emulation.
*
* Version: @(#)x86seg.c 1.0.1 2018/02/14
* Version: @(#)x86seg.c 1.0.2 2018/03/09
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -282,14 +282,14 @@ static void check_seg_valid(x86seg *s)
if (s->seg & 4)
{
if ((s->seg & ~7) >= ldt.limit)
if ((s->seg & ~7U) >= ldt.limit)
{
valid = 0;
}
}
else
{
if ((s->seg & ~7) >= gdt.limit)
if ((s->seg & ~7U) >= gdt.limit)
{
valid = 0;
}

View File

@@ -8,7 +8,7 @@
*
* x87 FPU instructions core.
*
* Version: @(#)x87_ops.h 1.0.2 2018/02/21
* Version: @(#)x87_ops.h 1.0.4 2018/03/09
*
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
* leilei,
@@ -214,7 +214,7 @@ static __inline void x87_st80(double d)
test.begin = (((int16_t)sign80)<<15)| (int16_t)exp80final;
test.eind.ll = mant80final;
writememl(easeg,cpu_state.eaaddr,test.eind.ll);
writememl(easeg,cpu_state.eaaddr,test.eind.ll & 0xffffffff);
writememl(easeg,cpu_state.eaaddr+4,test.eind.ll>>32);
writememw(easeg,cpu_state.eaaddr+8,test.begin);
}
@@ -266,7 +266,7 @@ static __inline void x87_stmmx(MMX_REG r)
static __inline uint16_t x87_compare(double a, double b)
{
#if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _WIN32
uint32_t out;
uint32_t result;
if (!is386)
{
@@ -282,7 +282,7 @@ static __inline uint16_t x87_compare(double a, double b)
"fclex\n"
"fcompp\n"
"fnstsw %0\n"
: "=m" (out)
: "=m" (result)
: "m" (a), "m" (a)
);
#else
@@ -293,11 +293,11 @@ static __inline uint16_t x87_compare(double a, double b)
fld a
fclex
fcompp
fnstsw out
fnstsw result
}
#endif
return out & (C0|C2|C3);
return result & (C0|C2|C3);
}
}
@@ -312,7 +312,7 @@ static __inline uint16_t x87_compare(double a, double b)
"fclex\n"
"fcompp\n"
"fnstsw %0\n"
: "=m" (out)
: "=m" (result)
: "m" (a), "m" (b)
);
#else
@@ -323,11 +323,11 @@ static __inline uint16_t x87_compare(double a, double b)
fld a
fclex
fcompp
fnstsw out
fnstsw result
}
#endif
return out & (C0|C2|C3);
return result & (C0|C2|C3);
#else
/* Generic C version is known to give incorrect results in some
* situations, eg comparison of infinity (Unreal) */
@@ -337,31 +337,31 @@ static __inline uint16_t x87_compare(double a, double b)
{
if (((a == INFINITY) || (a == -INFINITY)) && ((b == INFINITY) || (b == -INFINITY)))
{
out |= C3;
return out;
result |= C3;
return result;
}
if (a == b)
out |= C3;
result |= C3;
else if (a < b)
out |= C0;
result |= C0;
}
else
{
if (a == b)
out |= C3;
result |= C3;
else if (a < b)
out |= C0;
result |= C0;
}
return out;
return result;
#endif
}
static __inline uint16_t x87_ucompare(double a, double b)
{
#if defined i386 || defined __i386 || defined __i386__ || defined _X86_ || defined _WIN32
uint32_t out;
uint32_t result;
#ifndef _MSC_VER
/* Memory barrier, to force GCC to write to the input parameters
@@ -374,7 +374,7 @@ static __inline uint16_t x87_ucompare(double a, double b)
"fclex\n"
"fucompp\n"
"fnstsw %0\n"
: "=m" (out)
: "=m" (result)
: "m" (a), "m" (b)
);
#else
@@ -385,22 +385,22 @@ static __inline uint16_t x87_ucompare(double a, double b)
fld a
fclex
fcompp
fnstsw out
fnstsw result
}
#endif
return out & (C0|C2|C3);
return result & (C0|C2|C3);
#else
/* Generic C version is known to give incorrect results in some
* situations, eg comparison of infinity (Unreal) */
uint32_t out = 0;
uint32_t result = 0;
if (a == b)
out |= C3;
result |= C3;
else if (a < b)
out |= C0;
result |= C0;
return out;
return result;
#endif
}