Skip to content

Commit

Permalink
Implement ficomp for latest gcc
Browse files Browse the repository at this point in the history
Fixes #506
  • Loading branch information
tbodt committed Oct 6, 2019
1 parent 537a48e commit 3d11d05
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions emu/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
case 0xd97: TRACE("fnstcw mem16"); FSTCW(mem_addr); break;
case 0xda0: TRACE("fiadd mem32"); FIADD(mem_addr,32); break;
case 0xda1: TRACE("fimul mem32"); FIMUL(mem_addr,32); break;
case 0xda2: TRACE("ficom mem32"); FICOM(mem_addr,32); break;
case 0xda3: TRACE("ficomp mem32"); FICOM(mem_addr,32); FPOP; break;
case 0xda4: TRACE("fisub mem32"); FISUB(mem_addr,32); break;
case 0xda5: TRACE("fisubr mem32"); FISUBR(mem_addr,32); break;
case 0xda6: TRACE("fidiv mem32"); FIDIV(mem_addr,32); break;
Expand All @@ -591,6 +593,8 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
case 0xdd3: TRACE("fstp mem64"); FSTM(mem_addr_real,64); FPOP; break;
case 0xde0: TRACE("fiadd mem16"); FIADD(mem_addr,16); break;
case 0xde1: TRACE("fimul mem16"); FIMUL(mem_addr,16); break;
case 0xde2: TRACE("ficom mem16"); FICOM(mem_addr,16); break;
case 0xde3: TRACE("ficomp mem16"); FICOM(mem_addr,16); FPOP; break;
case 0xde4: TRACE("fisub mem16"); FISUB(mem_addr,16); break;
case 0xde5: TRACE("fisubr mem16"); FISUBR(mem_addr,16); break;
case 0xde6: TRACE("fidiv mem16"); FIDIV(mem_addr,16); break;
Expand Down
6 changes: 6 additions & 0 deletions emu/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ void fpu_comm32(struct cpu_state *cpu, float *f) {
void fpu_comm64(struct cpu_state *cpu, double *f) {
fpu_compare(cpu, f80_from_double(*f));
}
void fpu_icom16(struct cpu_state *cpu, int16_t *i) {
fpu_compare(cpu, f80_from_int(*i));
}
void fpu_icom32(struct cpu_state *cpu, int32_t *i) {
fpu_compare(cpu, f80_from_int(*i));
}
void fpu_tst(struct cpu_state *cpu) {
fpu_compare(cpu, fpu_consts[fconst_zero]);
}
Expand Down
2 changes: 2 additions & 0 deletions emu/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void fpu_2xm1(struct cpu_state *cpu);
void fpu_com(struct cpu_state *cpu, int i);
void fpu_comm32(struct cpu_state *cpu, float *f);
void fpu_comm64(struct cpu_state *cpu, double *f);
void fpu_icom16(struct cpu_state *cpu, int16_t *i);
void fpu_icom32(struct cpu_state *cpu, int32_t *i);
void fpu_comi(struct cpu_state *cpu, int i);
void fpu_tst(struct cpu_state *cpu);
#define fpu_ucom fpu_com
Expand Down
1 change: 1 addition & 0 deletions jit/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ void helper_rdtsc(struct cpu_state *cpu);
#define FXCH() hh(fpu_xch, st_i)
#define FCOM() hh(fpu_com, st_i)
#define FCOMM(val,z) h_read(fpu_comm, z)
#define FICOM(val,z) h_read(fpu_icom, z)
#define FUCOM() hh(fpu_ucom, st_i)
#define FUCOMI() hh(fpu_ucomi, st_i)
#define FCOMI() hh(fpu_comi, st_i)
Expand Down

0 comments on commit 3d11d05

Please sign in to comment.