Skip to content

Commit

Permalink
Change psllq/pslrq/paddq helper function names
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMerrill committed May 31, 2020
1 parent 309bcf3 commit 9f0835a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
10 changes: 3 additions & 7 deletions emu/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,10 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
case 0x73: READMODRM;
switch (modrm.opcode) {
case 0x02: TRACEI("psrlq imm, xmm");
READIMM8;
VSHIFTR_IMM(imm, xmm_modrm_reg,64);
break;
READIMM8; V_OP(imm_shiftr_q, imm, xmm_modrm_reg, 128); break;

case 0x06: TRACEI("psllq imm, xmm");
READIMM8;
VSHIFTL_IMM(imm, xmm_modrm_reg,64);
break;
READIMM8; V_OP(imm_shiftl_q, imm, xmm_modrm_reg, 128); break;

default: UNDEFINED;
}
Expand All @@ -311,7 +307,7 @@ __no_instrument DECODER_RET glue(DECODER_NAME, OP_SIZE)(DECODER_ARGS) {
READMODRM_NOMEM; READIMM8; V_OP_IMM(extract_w, xmm_modrm_val, modrm_reg,128); break;

case 0xd4: TRACEI("paddq xmm:modrm, xmm");
READMODRM; V_OP(add, xmm_modrm_val, xmm_modrm_reg, 64); break;
READMODRM; V_OP(add_q, xmm_modrm_val, xmm_modrm_reg, 128); break;

case 0xd6: TRACEI("movq xmm, xmm:modrm");
READMODRM; VMOV(xmm_modrm_reg, xmm_modrm_val,64); break;
Expand Down
6 changes: 3 additions & 3 deletions emu/vec.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void vec_merge128(NO_CPU, const void *src, void *dst) {
memcpy(dst, src, 16);
}

void vec_imm_shiftl64(NO_CPU, const uint8_t amount, union xmm_reg *dst) {
void vec_imm_shiftl_q128(NO_CPU, const uint8_t amount, union xmm_reg *dst) {
if (amount > 63) {
zero_xmm(dst);
} else {
Expand All @@ -67,7 +67,7 @@ void vec_imm_shiftl64(NO_CPU, const uint8_t amount, union xmm_reg *dst) {
}
}

void vec_imm_shiftr64(NO_CPU, const uint8_t amount, union xmm_reg *dst) {
void vec_imm_shiftr_q128(NO_CPU, const uint8_t amount, union xmm_reg *dst) {
if (amount > 63) {
zero_xmm(dst);
} else {
Expand All @@ -81,7 +81,7 @@ void vec_xor128(NO_CPU, union xmm_reg *src, union xmm_reg *dst) {
dst->qw[1] ^= src->qw[1];
}

void vec_add64(NO_CPU, union xmm_reg *src, union xmm_reg *dst) {
void vec_add_q128(NO_CPU, union xmm_reg *src, union xmm_reg *dst) {
dst->qw[0] += src->qw[0];
dst->qw[1] += src->qw[1];
}
Expand Down
6 changes: 3 additions & 3 deletions emu/vec.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ void vec_merge32(NO_CPU, const void *src, void *dst);
void vec_merge64(NO_CPU, const void *src, void *dst);
void vec_merge128(NO_CPU, const void *src, void *dst);

void vec_imm_shiftl64(NO_CPU, const uint8_t amount, union xmm_reg *dst);
void vec_imm_shiftr64(NO_CPU, const uint8_t amount, union xmm_reg *dst);
void vec_imm_shiftl_q128(NO_CPU, const uint8_t amount, union xmm_reg *dst);
void vec_imm_shiftr_q128(NO_CPU, const uint8_t amount, union xmm_reg *dst);
void vec_xor128(NO_CPU, union xmm_reg *src, union xmm_reg *dst);

void vec_add64(NO_CPU, union xmm_reg *src, union xmm_reg *dst);
void vec_add_q128(NO_CPU, union xmm_reg *src, union xmm_reg *dst);

void vec_fadds64(NO_CPU, const double *src, double *dst);
void vec_fmuls64(NO_CPU, const double *src, double *dst);
Expand Down
2 changes: 0 additions & 2 deletions jit/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,6 @@ static inline bool gen_vec(enum arg src, enum arg dst, void (*helper)(), gadget_
}

#define VCOMPARE(src, dst,z) v(compare, src, dst,z)
#define VSHIFTL_IMM(src, dst, z) v(imm_shiftl, src, dst,z)
#define VSHIFTR_IMM(src, dst, z) v(imm_shiftr, src, dst,z)
#define V_OP(op, src, dst, z) v(op, src, dst, z)
#define V_OP_IMM(op, src, dst, z) v_imm(op, src, dst, z)

Expand Down

0 comments on commit 9f0835a

Please sign in to comment.