Skip to content

Commit

Permalink
Implement finctsp
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Jan 2, 2020
1 parent dd8d3fb commit ac7898b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions emu/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
case 0xd960: TRACE("f2xm1"); F2XM1(); break;
case 0xd961: TRACE("fyl2x"); FYL2X(); break;
case 0xd963: TRACE("fpatan"); FPATAN(); break;
case 0xd967: TRACE("fincstp"); FINCSTP(); break;
case 0xd970: TRACE("fprem"); FPREM(); break;
case 0xd972: TRACE("fsqrt"); FSQRT(); break;
case 0xd974: TRACE("frndint"); FRNDINT(); break;
Expand Down
7 changes: 7 additions & 0 deletions emu/fpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ void fpu_xch(struct cpu_state *cpu, int i) {
ST(i) = tmp;
}

void fpu_incstp(struct cpu_state *cpu) {
// This is different from just popping the stack, it doesn't tag the stack
// element as free. We don't have stack tagging yet so in practice there's
// no difference.
cpu->top++;
}

// loads

void fpu_ld(struct cpu_state *cpu, int i) {
Expand Down
1 change: 1 addition & 0 deletions emu/fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static float80 fpu_consts[] = {

void fpu_pop(struct cpu_state *cpu);
void fpu_xch(struct cpu_state *cpu, int i);
void fpu_incstp(struct cpu_state *cpu);

void fpu_st(struct cpu_state *cpu, int i);
void fpu_ist16(struct cpu_state *cpu, int16_t *i);
Expand Down
1 change: 1 addition & 0 deletions jit/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ void helper_rdtsc(struct cpu_state *cpu);
#define FIDIVR(val,z) h_read(fpu_idivr, z)
#define FDIVRM(val,z) h_read(fpu_divrm, z)
#define FPATAN() h(fpu_patan)
#define FINCSTP() h(fpu_incstp)

// vector

Expand Down

0 comments on commit ac7898b

Please sign in to comment.