orc_sse_emit_loadil (OrcCompiler *p, int reg, int value)
{
if (value == 0) {
- orc_sse_emit_660f (p, "pxor", 0xef, reg, reg);
+ orc_sse_instr_pxor(p, reg, reg);
} else {
orc_x86_emit_mov_imm_reg (p, 4, value, p->gp_tmpreg);
orc_x86_emit_mov_reg_sse (p, p->gp_tmpreg, reg);
- orc_sse_emit_pshufd (p, 0, reg, reg);
+ orc_sse_instr_pshufd (p, 0, reg, reg);
}
}
(int)ORC_STRUCT_OFFSET(OrcExecutor, params[param]),
p->exec_reg, reg, FALSE);
- orc_sse_emit_660f (p, "punpcklbw", 0x60, reg, reg);
-
- orc_sse_emit_pshuflw (p, 0, reg, reg);
- orc_sse_emit_pshufd (p, 0, reg, reg);
+ orc_sse_instr_punpcklbw (p, reg, reg);
+ orc_sse_instr_pshuflw (p, 0, reg, reg);
+ orc_sse_instr_pshufd (p, 0, reg, reg);
}
void
static void
sse_rule_copyx (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- orc_sse_emit_660f (p, "movdqa", 0x6f,
+ orc_sse_instr_movdqa (p,
p->vars[insn->src_args[0]].alloc,
p->vars[insn->dest_args[0]].alloc);
}
int src = p->vars[insn->src_args[0]].alloc;
int dest = p->vars[insn->dest_args[0]].alloc;
- orc_sse_emit_660f (p, "paddw", 0xfd, src, dest);
+ orc_sse_instr_paddw (p, src, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
if (p->loop_shift == 0) {
- orc_sse_emit_shiftimm (p, "pslldq", 0x73, 7, 12, src);
+ orc_sse_instr_pslldq (p, 12, src);
}
- orc_sse_emit_660f (p, "paddd", 0xfe, src, dest);
+ orc_sse_instr_paddd (p, src, dest);
}
static void
int src1 = p->vars[insn->src_args[0]].alloc;
int src2 = p->vars[insn->src_args[1]].alloc;
int dest = p->vars[insn->dest_args[0]].alloc;
+ int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, src1, p->tmpreg);
- orc_sse_emit_660f (p, "psadbw", 0xf6, src2, p->tmpreg);
- orc_sse_emit_660f (p, "paddd", 0xfe, p->tmpreg, dest);
+ orc_sse_instr_movdqa (p, src1, tmp);
+ orc_sse_instr_psadbw (p, src2, tmp);
+ orc_sse_instr_paddd (p, tmp, dest);
}
static void
const char * names[] = { "psignb", "psignw", "psignd" };
int codes[] = { 0x3808, 0x3809, 0x380a };
int type = ORC_PTR_TO_INT(user);
+ int tmp = p->tmpreg;
+ int gptmp = p->gp_tmpreg;
if (src == dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, p->tmpreg);
- src = p->tmpreg;
+ orc_sse_instr_movdqa (p, src, tmp);
+ src = tmp;
}
- orc_x86_emit_mov_imm_reg (p, 4, imm_vals[type], p->gp_tmpreg);
+ orc_x86_emit_mov_imm_reg (p, 4, imm_vals[type], gptmp);
- orc_x86_emit_mov_reg_sse (p, p->gp_tmpreg, dest);
+ orc_x86_emit_mov_reg_sse (p, gptmp, dest);
orc_sse_emit_pshufd (p, 0, dest, dest);
orc_sse_emit_660f (p, names[type], codes[type], src, dest);
{
int src = p->vars[insn->src_args[0]].alloc;
int dest = p->vars[insn->dest_args[0]].alloc;
+ int tmp = p->tmpreg;
+ int gptmp = p->gp_tmpreg;
if (src != dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_x86_emit_mov_imm_reg (p, 4, 0x00010001, p->gp_tmpreg);
- orc_x86_emit_mov_reg_sse (p, p->gp_tmpreg, p->tmpreg);
- orc_sse_emit_pshufd (p, 0, p->tmpreg, p->tmpreg);
- orc_sse_emit_660f (p, "pminsw", 0xea, p->tmpreg, dest);
+ orc_x86_emit_mov_imm_reg (p, 4, 0x00010001, gptmp);
+ orc_x86_emit_mov_reg_sse (p, gptmp, tmp);
+ orc_sse_emit_pshufd (p, 0, tmp, tmp);
+ orc_sse_instr_pminsw (p, tmp, dest);
- orc_x86_emit_mov_imm_reg (p, 4, 0xffffffff, p->gp_tmpreg);
- orc_x86_emit_mov_reg_sse (p, p->gp_tmpreg, p->tmpreg);
- orc_sse_emit_pshufd (p, 0, p->tmpreg, p->tmpreg);
- orc_sse_emit_660f (p, "pmaxsw", 0xee, p->tmpreg, dest);
+ orc_x86_emit_mov_imm_reg (p, 4, 0xffffffff, gptmp);
+ orc_x86_emit_mov_reg_sse (p, gptmp, tmp);
+ orc_sse_emit_pshufd (p, 0, tmp, tmp);
+ orc_sse_instr_pmaxsw (p, tmp, dest);
}
static void
{
int src = p->vars[insn->src_args[0]].alloc;
int dest = p->vars[insn->dest_args[0]].alloc;
- int tmp;
+ int tmp = p->tmpreg;
if (src == dest) {
- tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, tmp);
+ orc_sse_instr_movdqa (p, src, tmp);
} else {
- tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, tmp);
- orc_sse_emit_660f (p, "movdqa", 0x6f, tmp, dest);
+ orc_sse_instr_movdqa (p, src, tmp);
+ orc_sse_instr_movdqa (p, tmp, dest);
}
- orc_sse_emit_shiftimm (p, "psraw", 0x71, 4, 15, tmp);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
- orc_sse_emit_660f (p, "psubw", 0xf9, tmp, dest);
+ orc_sse_instr_psraw (p, 15, tmp);
+ orc_sse_instr_pxor (p, tmp, dest);
+ orc_sse_instr_psubw (p, tmp, dest);
}
static void
sse_rule_convsbw (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- orc_sse_emit_660f (p, "punpcklbw", 0x60,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
- orc_sse_emit_shiftimm (p, "psraw", 0x71, 4, 8,
- p->vars[insn->dest_args[0]].alloc);
+ orc_sse_instr_punpcklbw (p, src, dest);
+ orc_sse_instr_psraw (p, 8, dest);
}
static void
sse_rule_convubw (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- /* FIXME need a zero register */
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
+ int tmp = p->tmpreg;
+ /* FIXME need a zero register */
if (0) {
- orc_sse_emit_660f (p, "punpcklbw", 0x60,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
-
- orc_sse_emit_shiftimm (p, "psrlw", 0x71, 2, 8,
- p->vars[insn->dest_args[0]].alloc);
+ orc_sse_instr_punpcklbw (p, src, dest);
+ orc_sse_instr_psrlw (p, 8, dest);
} else {
- if (p->vars[insn->src_args[0]].alloc !=
- p->vars[insn->dest_args[0]].alloc) {
- orc_sse_emit_660f (p, "movdqa", 0x6f,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ if (src != dest) {
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pxor", 0xef,
- p->tmpreg, p->tmpreg);
- orc_sse_emit_660f (p, "punpcklbw", 0x60,
- p->tmpreg,
- p->vars[insn->dest_args[0]].alloc);
+ orc_sse_instr_pxor(p, tmp, tmp);
+ orc_sse_instr_punpcklbw (p, tmp, dest);
}
}
static void
sse_rule_convssswb (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- orc_sse_emit_660f (p, "packsswb", 0x63,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
+
+ orc_sse_instr_packsswb (p, src, dest);
}
static void
sse_rule_convsuswb (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- orc_sse_emit_660f (p, "packuswb", 0x67,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
+
+ orc_sse_instr_packuswb (p, src, dest);
}
static void
/* FIXME slow */
if (dest != src) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_shiftimm (p, "psllw", 0x71, 6, 8,
- p->vars[insn->dest_args[0]].alloc);
- orc_sse_emit_shiftimm (p, "psrlw", 0x71, 2, 8,
- p->vars[insn->dest_args[0]].alloc);
- orc_sse_emit_660f (p, "packuswb", 0x67,
- p->vars[insn->dest_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ orc_sse_instr_psllw (p, 8, dest);
+ orc_sse_instr_psrlw (p, 8, dest);
+ orc_sse_instr_packuswb (p, dest, dest);
}
static void
sse_rule_convswl (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- orc_sse_emit_660f (p, "punpcklwd", 0x61,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
- orc_sse_emit_shiftimm (p, "psrad", 0x72, 4, 16,
- p->vars[insn->dest_args[0]].alloc);
+ orc_sse_instr_punpcklwd (p, src, dest);
+ orc_sse_instr_psrad (p, 16, dest);
}
static void
sse_rule_convuwl (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- /* FIXME need a zero register */
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
+ int tmp = p->tmpreg;
+ /* FIXME need a zero register */
if (0) {
- orc_sse_emit_660f (p, "punpcklwd", 0x61,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
- orc_sse_emit_shiftimm (p, "psrld", 0x72, 2, 16,
- p->vars[insn->dest_args[0]].alloc);
+ orc_sse_instr_punpcklwd (p, src, dest);
+ orc_sse_instr_psrld (p, 16, dest);
} else {
- if (p->vars[insn->src_args[0]].alloc !=
- p->vars[insn->dest_args[0]].alloc) {
- orc_sse_emit_660f (p, "movdqa", 0x6f,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ if (src != dest) {
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pxor", 0xef,
- p->tmpreg, p->tmpreg);
- orc_sse_emit_660f (p, "punpcklwd", 0x61,
- p->tmpreg,
- p->vars[insn->dest_args[0]].alloc);
+ orc_sse_instr_pxor(p, tmp, tmp);
+ orc_sse_instr_punpcklwd (p, tmp, dest);
}
}
/* FIXME slow */
if (dest != src) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_shiftimm (p, "pslld", 0x72, 6, 16,
- p->vars[insn->dest_args[0]].alloc);
- orc_sse_emit_shiftimm (p, "psrad", 0x72, 4, 16,
- p->vars[insn->dest_args[0]].alloc);
- orc_sse_emit_660f (p, "packssdw", 0x6b, dest, dest);
+ orc_sse_instr_pslld (p, 16, dest);
+ orc_sse_instr_psrad (p, 16, dest);
+ orc_sse_instr_packssdw (p, dest, dest);
}
static void
sse_rule_convssslw (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- orc_sse_emit_660f (p, "packssdw", 0x6b,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
+
+ orc_sse_instr_packssdw (p, src, dest);
}
static void
sse_rule_convsuslw (OrcCompiler *p, void *user, OrcInstruction *insn)
{
- orc_sse_emit_660f (p, "packusdw", 0x382b,
- p->vars[insn->src_args[0]].alloc,
- p->vars[insn->dest_args[0]].alloc);
+ int src = p->vars[insn->src_args[0]].alloc;
+ int dest = p->vars[insn->dest_args[0]].alloc;
+
+ orc_sse_instr_packusdw (p, src, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "punpcklbw", 0x60, src, tmp);
- orc_sse_emit_shiftimm (p, "psraw", 0x71, 4, 8, tmp);
- orc_sse_emit_660f (p, "punpcklbw", 0x60, dest, dest);
- orc_sse_emit_shiftimm (p, "psraw", 0x71, 4, 8, dest);
- orc_sse_emit_660f (p, "pmullw", 0xd5, tmp, dest);
+ orc_sse_instr_punpcklbw (p, src, tmp);
+ orc_sse_instr_psraw (p, 8, tmp);
+ orc_sse_instr_punpcklbw (p, dest, dest);
+ orc_sse_instr_psraw (p, 8, dest);
+ orc_sse_instr_pmullw (p, tmp, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "punpcklbw", 0x60, src, tmp);
- orc_sse_emit_shiftimm (p, "psrlw", 0x71, 2, 8, tmp);
- orc_sse_emit_660f (p, "punpcklbw", 0x60, dest, dest);
- orc_sse_emit_shiftimm (p, "psrlw", 0x71, 2, 8, dest);
- orc_sse_emit_660f (p, "pmullw", 0xd5, tmp, dest);
+ orc_sse_instr_punpcklbw (p, src, tmp);
+ orc_sse_instr_psrlw (p, 8, tmp);
+ orc_sse_instr_punpcklbw (p, dest, dest);
+ orc_sse_instr_psrlw (p, 8, dest);
+ orc_sse_instr_pmullw (p, tmp, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, dest, tmp);
- orc_sse_emit_660f (p, "pmulhw", 0xe5, src, tmp);
- orc_sse_emit_660f (p, "pmullw", 0xd5, src, dest);
- orc_sse_emit_660f (p, "punpcklwd", 0x61, tmp, dest);
+ orc_sse_instr_movdqa (p, dest, tmp);
+ orc_sse_instr_pmulhw (p, src, tmp);
+ orc_sse_instr_pmullw (p, src, dest);
+ orc_sse_instr_punpcklwd (p, tmp, dest);
}
static void
/* same as convlw */
if (dest != src) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_shiftimm (p, "pslld", 0x72, 6, 16, dest);
- orc_sse_emit_shiftimm (p, "psrad", 0x72, 4, 16, dest);
- orc_sse_emit_660f (p, "packssdw", 0x6b, dest, dest);
+ orc_sse_instr_pslld (p, 16, dest);
+ orc_sse_instr_psrad (p, 16, dest);
+ orc_sse_instr_packssdw (p, dest, dest);
}
static void
/* FIXME slow */
if (dest != src) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_shiftimm (p, "psrad", 0x72, 4, 16, dest);
- orc_sse_emit_660f (p, "packssdw", 0x6b, dest, dest);
+ orc_sse_instr_psrad (p, 16, dest);
+ orc_sse_instr_packssdw (p, dest, dest);
}
static void
/* same as convwb */
if (dest != src) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_shiftimm (p, "psllw", 0x71, 6, 8, dest);
- orc_sse_emit_shiftimm (p, "psraw", 0x71, 4, 8, dest);
- orc_sse_emit_660f (p, "packsswb", 0x63, dest, dest);
+ orc_sse_instr_psllw (p, 8, dest);
+ orc_sse_instr_psraw (p, 8, dest);
+ orc_sse_instr_packsswb (p, dest, dest);
}
static void
/* FIXME slow */
if (dest != src) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_shiftimm (p, "psraw", 0x71, 4, 8, dest);
- orc_sse_emit_660f (p, "packsswb", 0x63, dest, dest);
+ orc_sse_instr_psraw (p, 8, dest);
+ orc_sse_instr_packsswb (p, dest, dest);
}
static void
int src = p->vars[insn->src_args[1]].alloc;
int dest = p->vars[insn->dest_args[0]].alloc;
- orc_sse_emit_660f (p, "punpcklbw", 0x60, src, dest);
+ orc_sse_instr_punpcklbw (p, src, dest);
}
static void
int src = p->vars[insn->src_args[1]].alloc;
int dest = p->vars[insn->dest_args[0]].alloc;
- orc_sse_emit_660f (p, "punpcklwd", 0x61, src, dest);
+ orc_sse_instr_punpcklwd (p, src, dest);
}
static void
sse_emit_load_mask (OrcCompiler *p, unsigned int mask1, unsigned int mask2)
{
int tmp = p->tmpreg;
+ int gptmp = p->gp_tmpreg;
int tmp2 = X86_XMM7;
- orc_x86_emit_mov_imm_reg (p, 4, mask1, p->gp_tmpreg);
- orc_x86_emit_mov_reg_sse (p, p->gp_tmpreg, p->tmpreg);
+ orc_x86_emit_mov_imm_reg (p, 4, mask1, gptmp);
+ orc_x86_emit_mov_reg_sse (p, gptmp, tmp);
orc_sse_emit_pshufd (p, 0, tmp, tmp);
- orc_x86_emit_mov_imm_reg (p, 4, mask2, p->gp_tmpreg);
- orc_x86_emit_mov_reg_sse (p, p->gp_tmpreg, tmp2);
- orc_sse_emit_660f (p, "punpcklbw", 0x60, tmp2, tmp2);
- orc_sse_emit_660f (p, "punpcklwd", 0x61, tmp2, tmp2);
- orc_sse_emit_660f (p, "paddb", 0xfc, tmp2, tmp);
+ orc_x86_emit_mov_imm_reg (p, 4, mask2, gptmp);
+ orc_x86_emit_mov_reg_sse (p, gptmp, tmp2);
+ orc_sse_instr_punpcklbw (p, tmp2, tmp2);
+ orc_sse_instr_punpcklwd (p, tmp2, tmp2);
+ orc_sse_instr_paddb (p, tmp2, tmp);
}
static void
sse_emit_load_mask (p, 0x05040100, 0x08000800);
if (src != dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pshufb", 0x3800, tmp, dest);
+ orc_sse_instr_pshufb (p, tmp, dest);
}
static void
sse_emit_load_mask (p, 0x07060302, 0x08000800);
if (src != dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pshufb", 0x3800, tmp, dest);
+ orc_sse_instr_pshufb (p, tmp, dest);
}
static void
sse_emit_load_mask (p, 0x06040200, 0x08000800);
if (src != dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pshufb", 0x3800, tmp, dest);
+ orc_sse_instr_pshufb (p, tmp, dest);
}
static void
sse_emit_load_mask (p, 0x07050301, 0x08000800);
if (src != dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pshufb", 0x3800, tmp, dest);
+ orc_sse_instr_pshufb (p, tmp, dest);
}
/* slow rules */
sse_emit_load_mask (p, 0x02030001, 0x0c080400);
if (src != dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pshufb", 0x3800, tmp, dest);
+ orc_sse_instr_pshufb (p, tmp, dest);
}
static void
sse_emit_load_mask (p, 0x00010203, 0x0c080400);
if (src != dest) {
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, dest);
+ orc_sse_instr_movdqa (p, src, dest);
}
- orc_sse_emit_660f (p, "pshufb", 0x3800, tmp, dest);
+ orc_sse_instr_pshufb (p, tmp, dest);
}
static void
int src = p->vars[insn->src_args[1]].alloc;
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
+ int gptmp = p->gp_tmpreg;
- orc_x86_emit_mov_imm_reg (p, 4, 0x80008000, p->gp_tmpreg);
- orc_x86_emit_mov_reg_sse (p, p->gp_tmpreg, tmp);
+ orc_x86_emit_mov_imm_reg (p, 4, 0x80008000, gptmp);
+ orc_x86_emit_mov_reg_sse (p, gptmp, tmp);
orc_sse_emit_pshufd (p, 0, tmp, tmp);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
- orc_sse_emit_660f (p, "pmaxsw", 0xee, src, dest);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
+ orc_sse_instr_pmaxsw (p, src, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
}
static void
orc_sse_emit_loadiw (p, tmp, 0x8000);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
- orc_sse_emit_660f (p, "pminsw", 0xea, src, dest);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
+ orc_sse_instr_pminsw (p, src, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
}
static void
orc_sse_emit_loadib (p, tmp, 0x80);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
- orc_sse_emit_660f (p, "pavgb", 0xe0, src, dest);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
+ orc_sse_instr_pavgb (p, src, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
}
static void
orc_sse_emit_loadiw (p, tmp, 0x8000);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
- orc_sse_emit_660f (p, "pavgw", 0xe3, src, dest);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
+ orc_sse_instr_pavgw (p, src, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, dest, tmp);
- orc_sse_emit_660f (p, "pcmpgtb", 0x64, src, tmp);
- orc_sse_emit_660f (p, "pand", 0xdb, tmp, dest);
- orc_sse_emit_660f (p, "pandn", 0xdf, src, tmp);
- orc_sse_emit_660f (p, "por", 0xeb, tmp, dest);
+ orc_sse_instr_movdqa (p, dest, tmp);
+ orc_sse_instr_pcmpgtb (p, src, tmp);
+ orc_sse_instr_pand (p, tmp, dest);
+ orc_sse_instr_pandn (p, src, tmp);
+ orc_sse_instr_por (p, tmp, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, tmp);
- orc_sse_emit_660f (p, "pcmpgtb", 0x64, dest, tmp);
- orc_sse_emit_660f (p, "pand", 0xdb, tmp, dest);
- orc_sse_emit_660f (p, "pandn", 0xdf, src, tmp);
- orc_sse_emit_660f (p, "por", 0xeb, tmp, dest);
+ orc_sse_instr_movdqa (p, src, tmp);
+ orc_sse_instr_pcmpgtb (p, dest, tmp);
+ orc_sse_instr_pand (p, tmp, dest);
+ orc_sse_instr_pandn (p, src, tmp);
+ orc_sse_instr_por (p, tmp, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, dest, tmp);
- orc_sse_emit_660f (p, "pcmpgtd", 0x66, src, tmp);
- orc_sse_emit_660f (p, "pand", 0xdb, tmp, dest);
- orc_sse_emit_660f (p, "pandn", 0xdf, src, tmp);
- orc_sse_emit_660f (p, "por", 0xeb, tmp, dest);
+ orc_sse_instr_movdqa (p, dest, tmp);
+ orc_sse_instr_pcmpgtd (p, src, tmp);
+ orc_sse_instr_pand (p, tmp, dest);
+ orc_sse_instr_pandn (p, src, tmp);
+ orc_sse_instr_por (p, tmp, dest);
}
static void
int dest = p->vars[insn->dest_args[0]].alloc;
int tmp = p->tmpreg;
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, tmp);
- orc_sse_emit_660f (p, "pcmpgtd", 0x66, dest, tmp);
- orc_sse_emit_660f (p, "pand", 0xdb, tmp, dest);
- orc_sse_emit_660f (p, "pandn", 0xdf, src, tmp);
- orc_sse_emit_660f (p, "por", 0xeb, tmp, dest);
+ orc_sse_instr_movdqa (p, src, tmp);
+ orc_sse_instr_pcmpgtd (p, dest, tmp);
+ orc_sse_instr_pand (p, tmp, dest);
+ orc_sse_instr_pandn (p, src, tmp);
+ orc_sse_instr_por (p, tmp, dest);
}
static void
int tmp = p->tmpreg;
orc_sse_emit_loadil (p, tmp, 0x80000000);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
- orc_sse_emit_660f (p, "movdqa", 0x6f, dest, tmp);
- orc_sse_emit_660f (p, "pcmpgtd", 0x66, src, tmp);
- orc_sse_emit_660f (p, "pand", 0xdb, tmp, dest);
- orc_sse_emit_660f (p, "pandn", 0xdf, src, tmp);
- orc_sse_emit_660f (p, "por", 0xeb, tmp, dest);
+ orc_sse_instr_movdqa (p, dest, tmp);
+ orc_sse_instr_pcmpgtd (p, src, tmp);
+ orc_sse_instr_pand (p, tmp, dest);
+ orc_sse_instr_pandn (p, src, tmp);
+ orc_sse_instr_por (p, tmp, dest);
orc_sse_emit_loadil (p, tmp, 0x80000000);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
}
static void
int tmp = p->tmpreg;
orc_sse_emit_loadil (p, tmp, 0x80000000);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
- orc_sse_emit_660f (p, "movdqa", 0x6f, src, tmp);
- orc_sse_emit_660f (p, "pcmpgtd", 0x66, dest, tmp);
- orc_sse_emit_660f (p, "pand", 0xdb, tmp, dest);
- orc_sse_emit_660f (p, "pandn", 0xdf, src, tmp);
- orc_sse_emit_660f (p, "por", 0xeb, tmp, dest);
+ orc_sse_instr_movdqa (p, src, tmp);
+ orc_sse_instr_pcmpgtd (p, dest, tmp);
+ orc_sse_instr_pand (p, tmp, dest);
+ orc_sse_instr_pandn (p, src, tmp);
+ orc_sse_instr_por (p, tmp, dest);
orc_sse_emit_loadil (p, tmp, 0x80000000);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, src);
- orc_sse_emit_660f (p, "pxor", 0xef, tmp, dest);
+ orc_sse_instr_pxor(p, tmp, src);
+ orc_sse_instr_pxor(p, tmp, dest);
}