From 8d095894d4b69c6914dca622848fcf0e627e8fac Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 12 May 2011 12:30:40 -0700 Subject: [PATCH] x86insn: cleanup --- orc/orcprogram-sse.c | 6 +++--- orc/orcrules-sse.c | 18 +++++++++--------- orc/orcsse.c | 26 -------------------------- orc/orcsse.h | 13 ------------- orc/orcx86insn.h | 2 +- 5 files changed, 13 insertions(+), 52 deletions(-) diff --git a/orc/orcprogram-sse.c b/orc/orcprogram-sse.c index d565850..3f86924 100644 --- a/orc/orcprogram-sse.c +++ b/orc/orcprogram-sse.c @@ -318,7 +318,7 @@ sse_save_accumulators (OrcCompiler *compiler) } if (compiler->vars[i].size == 2) { - orc_x86_emit_mov_sse_reg (compiler, src, compiler->gp_tmpreg); + orc_sse_emit_movd_store_register (compiler, src, compiler->gp_tmpreg); orc_x86_emit_and_imm_reg (compiler, 4, 0xffff, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 4, compiler->gp_tmpreg, (int)ORC_STRUCT_OFFSET(OrcExecutor, accumulators[i-ORC_VAR_A1]), @@ -429,7 +429,7 @@ orc_sse_load_constant (OrcCompiler *compiler, int reg, int size, orc_uint64 valu } orc_x86_emit_mov_imm_reg (compiler, 4, value, compiler->gp_tmpreg); - orc_x86_emit_mov_reg_sse (compiler, compiler->gp_tmpreg, reg); + orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, reg); #ifndef MMX orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(0,0,0,0), reg, reg); #else @@ -1024,7 +1024,7 @@ orc_sse_emit_loop (OrcCompiler *compiler, int offset, int update) if (!(insn->opcode->flags & (ORC_STATIC_OPCODE_ACCUMULATOR|ORC_STATIC_OPCODE_LOAD|ORC_STATIC_OPCODE_STORE)) && compiler->vars[insn->dest_args[0]].alloc != compiler->vars[insn->src_args[0]].alloc) { - orc_x86_emit_mov_sse_reg_reg (compiler, + orc_sse_emit_movdqu (compiler, compiler->vars[insn->src_args[0]].alloc, compiler->vars[insn->dest_args[0]].alloc); } diff --git a/orc/orcrules-sse.c b/orc/orcrules-sse.c index aa233f5..ce8d75c 100644 --- a/orc/orcrules-sse.c +++ b/orc/orcrules-sse.c @@ -32,7 +32,7 @@ sse_rule_loadpX (OrcCompiler *compiler, void *user, OrcInstruction *insn) (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0]]), compiler->exec_reg, reg, FALSE); #ifndef MMX - orc_x86_emit_movhps_memoffset_sse (compiler, + orc_sse_emit_movhps_load_memoffset (compiler, (int)ORC_STRUCT_OFFSET(OrcExecutor, params[insn->src_args[0] + (ORC_VAR_T1 - ORC_VAR_P1)]), compiler->exec_reg, reg); @@ -106,7 +106,7 @@ sse_rule_loadX (OrcCompiler *compiler, void *user, OrcInstruction *insn) case 1: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); - orc_x86_emit_mov_reg_sse (compiler, compiler->gp_tmpreg, dest->alloc); + orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 2: orc_sse_emit_pxor (compiler, dest->alloc, dest->alloc); @@ -161,7 +161,7 @@ sse_rule_loadoffX (OrcCompiler *compiler, void *user, OrcInstruction *insn) case 1: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); - orc_x86_emit_mov_reg_sse (compiler, compiler->gp_tmpreg, dest->alloc); + orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 2: orc_sse_emit_pxor (compiler, dest->alloc, dest->alloc); @@ -271,7 +271,7 @@ sse_rule_loadupdb (OrcCompiler *compiler, void *user, OrcInstruction *insn) case 2: orc_x86_emit_mov_memoffset_reg (compiler, 1, offset, ptr_reg, compiler->gp_tmpreg); - orc_x86_emit_mov_reg_sse (compiler, compiler->gp_tmpreg, dest->alloc); + orc_sse_emit_movd_load_register (compiler, compiler->gp_tmpreg, dest->alloc); break; case 4: orc_sse_emit_pinsrw_memoffset (compiler, 0, offset, ptr_reg, dest->alloc); @@ -330,7 +330,7 @@ sse_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) if (ptr_reg == compiler->gp_tmpreg) { ORC_COMPILER_ERROR(compiler,"unimplemented"); } - orc_x86_emit_mov_sse_reg (compiler, src->alloc, compiler->gp_tmpreg); + orc_sse_emit_movd_store_register (compiler, src->alloc, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 1, compiler->gp_tmpreg, offset, ptr_reg); break; @@ -343,7 +343,7 @@ sse_rule_storeX (OrcCompiler *compiler, void *user, OrcInstruction *insn) if (ptr_reg == compiler->gp_tmpreg) { ORC_COMPILER_ERROR(compiler,"unimplemented"); } - orc_x86_emit_mov_sse_reg (compiler, src->alloc, compiler->gp_tmpreg); + orc_sse_emit_movd_store_register (compiler, src->alloc, compiler->gp_tmpreg); orc_x86_emit_mov_reg_memoffset (compiler, 2, compiler->gp_tmpreg, offset, ptr_reg); } @@ -378,7 +378,7 @@ sse_rule_ldresnearl (OrcCompiler *compiler, void *user, OrcInstruction *insn) int tmp2 = orc_compiler_get_temp_reg (compiler); int tmpc; - orc_x86_emit_mov_sse_reg (compiler, X86_XMM6, compiler->gp_tmpreg); + orc_sse_emit_movd_store_register (compiler, X86_XMM6, compiler->gp_tmpreg); orc_x86_emit_sar_imm_reg (compiler, 4, 16, compiler->gp_tmpreg); orc_sse_emit_movdqu_load_memindex (compiler, 0, src->ptr_register, @@ -490,7 +490,7 @@ sse_rule_ldreslinl (OrcCompiler *compiler, void *user, OrcInstruction *insn) orc_sse_emit_pshufd (compiler, ORC_SSE_SHUF(3,2,3,2), tmp, tmp2); orc_sse_emit_psubw (compiler, tmp, tmp2); - orc_x86_emit_mov_reg_sse (compiler, src->ptr_offset, tmp); + orc_sse_emit_movd_load_register (compiler, src->ptr_offset, tmp); orc_sse_emit_pshuflw (compiler, ORC_SSE_SHUF(0,0,0,0), tmp, tmp); orc_sse_emit_psrlw_imm (compiler, 8, tmp); orc_sse_emit_pmullw (compiler, tmp2, tmp); @@ -525,7 +525,7 @@ sse_rule_ldreslinl (OrcCompiler *compiler, void *user, OrcInstruction *insn) for(i=0;i<(1<loop_shift);i+=2){ orc_x86_emit_mov_memoffset_sse (compiler, 8, 0, src->ptr_register, tmp, FALSE); - orc_x86_emit_mov_reg_sse (compiler, src->ptr_offset, tmp4); + orc_sse_emit_movd_load_register (compiler, src->ptr_offset, tmp4); if (compiler->vars[increment_var].vartype == ORC_VAR_TYPE_PARAM) { orc_x86_emit_add_memoffset_reg (compiler, 4, diff --git a/orc/orcsse.c b/orc/orcsse.c index a19a045..f14f398 100644 --- a/orc/orcsse.c +++ b/orc/orcsse.c @@ -64,13 +64,6 @@ orc_x86_emit_mov_memoffset_sse (OrcCompiler *compiler, int size, int offset, } void -orc_x86_emit_movhps_memoffset_sse (OrcCompiler *compiler, int offset, - int reg1, int reg2) -{ - orc_sse_emit_movhps_load_memoffset (compiler, offset, reg1, reg2); -} - -void orc_x86_emit_mov_memindex_sse (OrcCompiler *compiler, int size, int offset, int reg1, int regindex, int shift, int reg2, int is_aligned) { @@ -127,25 +120,6 @@ orc_x86_emit_mov_sse_memoffset (OrcCompiler *compiler, int size, int reg1, int o } -void orc_x86_emit_mov_sse_reg_reg (OrcCompiler *compiler, int reg1, int reg2) -{ - if (reg1 == reg2) { - return; - } - - orc_sse_emit_movdqu (compiler, offset, reg1, reg2); -} - -void orc_x86_emit_mov_reg_sse (OrcCompiler *compiler, int reg1, int reg2) -{ - orc_sse_emit_movd_load_register (compiler, reg1, reg2); -} - -void orc_x86_emit_mov_sse_reg (OrcCompiler *compiler, int reg1, int reg2) -{ - orc_sse_emit_movd_store_register (compiler, reg1, reg2); -} - void orc_sse_set_mxcsr (OrcCompiler *compiler) { diff --git a/orc/orcsse.h b/orc/orcsse.h index 351dbd2..ff30006 100644 --- a/orc/orcsse.h +++ b/orc/orcsse.h @@ -46,23 +46,10 @@ typedef enum { const char * orc_x86_get_regname_sse(int i); void orc_x86_emit_mov_memoffset_sse (OrcCompiler *compiler, int size, int offset, int reg1, int reg2, int is_aligned); -void orc_x86_emit_movhps_memoffset_sse (OrcCompiler *compiler, int offset, - int reg1, int reg2); void orc_x86_emit_mov_memindex_sse (OrcCompiler *compiler, int size, int offset, int reg1, int regindex, int shift, int reg2, int is_aligned); void orc_x86_emit_mov_sse_memoffset (OrcCompiler *compiler, int size, int reg1, int offset, int reg2, int aligned, int uncached); -void orc_x86_emit_mov_sse_reg_reg (OrcCompiler *compiler, int reg1, int reg2); -void orc_x86_emit_mov_reg_sse (OrcCompiler *compiler, int reg1, int reg2); -void orc_x86_emit_mov_sse_reg (OrcCompiler *compiler, int reg1, int reg2); -void orc_sse_emit_loadib (OrcCompiler *p, int reg, int value); -void orc_sse_emit_loadiw (OrcCompiler *p, int reg, int value); -void orc_sse_emit_loadil (OrcCompiler *p, int reg, int value); -void orc_sse_emit_loadpb (OrcCompiler *p, int reg, int value); -void orc_sse_emit_loadpw (OrcCompiler *p, int reg, int value); -void orc_sse_emit_loadpl (OrcCompiler *p, int reg, int value); -void orc_sse_emit_loadpq (OrcCompiler *p, int reg, int value); - void orc_sse_set_mxcsr (OrcCompiler *compiler); void orc_sse_restore_mxcsr (OrcCompiler *compiler); diff --git a/orc/orcx86insn.h b/orc/orcx86insn.h index 6e3260f..ad4be89 100644 --- a/orc/orcx86insn.h +++ b/orc/orcx86insn.h @@ -445,7 +445,7 @@ void orc_x86_calculate_offsets (OrcCompiler *p); #define orc_sse_emit_pshuflw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshuflw, imm, a, b) #define orc_sse_emit_pshufhw(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_pshufhw, imm, a, b) #define orc_sse_emit_palignr(p,imm,a,b) orc_x86_emit_cpuinsn_imm(p, ORC_X86_psalignr, imm, a, b) -#define orc_sse_emit_movdqu(p,offset,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movdqu_load, 16, a, b) +#define orc_sse_emit_movdqu(p,a,b) orc_x86_emit_cpuinsn_size(p, ORC_X86_movdqu_load, 16, a, b) #define orc_sse_emit_pinsrw_memoffset(p,imm,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_pinsrw, 4, imm, offset, a, b) #define orc_sse_emit_movd_load_memoffset(p,offset,a,b) orc_x86_emit_cpuinsn_load_memoffset(p, ORC_X86_movd_load, 4, 0, offset, a, b) -- 2.7.4