Skip to content

Commit

Permalink
Implement cvttss2si
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Jun 6, 2020
1 parent b7ea9ff commit afa3240
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions emu/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,8 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {

case 0x2a: TRACEI("cvtsi2ss modrm, xmm");
READMODRM; V_OP(cvtsi2ss, modrm_val, xmm_modrm_reg,32); break;
case 0x2c: TRACEI("cvttss2si reg, xmm:modrm");
READMODRM; V_OP(cvttss2si, xmm_modrm_val, modrm_reg,32); break;
case 0x5a: TRACEI("cvtss2sd xmm:modrm, xmm");
READMODRM; V_OP(cvtss2sd, xmm_modrm_val, xmm_modrm_reg,32); break;

Expand Down
3 changes: 2 additions & 1 deletion emu/vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ void vec_single_fdiv32(NO_CPU, const float *src, float *dst) { *dst /= *src; }
*dst = *src; \
}
VEC_CVT(si2sd32, uint32_t, double)
VEC_CVT(si2ss32, uint32_t, float)
VEC_CVT(tsd2si64, double, uint32_t)
VEC_CVT(sd2ss64, double, float)
VEC_CVT(si2ss32, uint32_t, float)
VEC_CVT(tss2si32, float, uint32_t)
VEC_CVT(ss2sd32, float, double)

void vec_unpack_bw128(NO_CPU, const union xmm_reg *src, union xmm_reg *dst) {
Expand Down
3 changes: 2 additions & 1 deletion emu/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ void vec_single_fsub32(NO_CPU, const float *src, float *dst);
void vec_single_fdiv32(NO_CPU, const float *src, float *dst);

void vec_cvtsi2sd32(NO_CPU, const uint32_t *src, double *dst);
void vec_cvtsi2ss32(NO_CPU, const uint32_t *src, float *dst);
void vec_cvttsd2si64(NO_CPU, const double *src, uint32_t *dst);
void vec_cvtsd2ss64(NO_CPU, const double *src, float *dst);
void vec_cvtsi2ss32(NO_CPU, const uint32_t *src, float *dst);
void vec_cvttss2si32(NO_CPU, const float *src, uint32_t *dst);
void vec_cvtss2sd32(NO_CPU, const float *src, double *dst);

// TODO organize
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/qemu/qemu-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2632,7 +2632,7 @@ void test_sse(void)
// CVT_OP_XMM2MMX(cvtps2pi);
// CVT_OP_XMM2MMX(cvttps2pi);
// CVT_OP_XMM2REG(cvtss2si);
// CVT_OP_XMM2REG(cvttss2si);
CVT_OP_XMM2REG(cvttss2si);
// CVT_OP_XMM(cvtps2dq);
// CVT_OP_XMM(cvttps2dq);

Expand Down

0 comments on commit afa3240

Please sign in to comment.